{extend name="user_base" /} {block name="seo"}
<title>修改密码 - {$site_config['seo_title']}</title>
<meta name="keywords" content="{$site_config['seo_keyword']}">
<meta name="description" content="{$site_config['seo_description']}">
{/block}
{block name="css"}
{/block}
{block name="main"}
<div class="title">
    修改密码
</div>
<div class="changes layui-form">
<!--    <span class="user-now">当前账号： 无  <a href="safe.html">[绑定]</a> </span>-->
    <input type="password" name="old_password" lay-verify="password" placeholder="原密码" />            <input type="password" name="password" lay-verify="password" placeholder="输入6-12位的密码"/>
    <input type="password" name="password_confirm" lay-verify="password_confirm" placeholder="确认密码"/>
    <button class="submit" lay-submit lay-filter="savePassword">修改密码</button>
</div>
{/block}
{block name="script"}

<script>
    layui.use('form', function () {

        var form = layui.form;

        form.verify({
            password: function (val, item) {
                if (!val || (val.length) < 6 || (val.length) > 18) {
                    return '密码只能填写 6 - 18 为字符!';
                }
            }
            , password_confirm: function (val, item) {
                var pwd = $(item).siblings('input[name=password]').val()
                if (pwd !== val) {
                    return "两次密码输入不一致!";
                }
            }
        });

        form.on('submit(savePassword)', function (data) {
            request({data: data.field,});
            return false;
        });
    })
</script>
{/block}